# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=bed
pkgver=0.5
pkgrel=13
groups=('blackarch' 'blackarch-exploitation')
pkgdesc='Collection of scripts to test for buffer overflows, format string vulnerabilities.'
arch=('any')
url='http://www.aldeid.com/wiki/Bed'
license=('GPL')
depends=('perl')
source=("http://web.archive.org/web/20101229024258/http://www.remote-exploit.org/wp-content/uploads/2010/01/bed-$pkgver.tar.gz")
sha512sums=('b0813fe4cce7626998b60b9238155a91d221df223331dbb866a76b69e9eab7f3ff445a2c29141628545a56c6d93b2cfacfe8cfbecc4cf49d85e9d406c28e6bae')

package() {
  cd "$pkgname-$pkgver"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"
  install -dm 755 "$pkgdir/usr/share/doc/$pkgname"

  install -m 755 "$pkgname.pl" "$pkgdir/usr/share/$pkgname"

  cp --no-preserve=ownership -a bedmod "$pkgdir/usr/share/$pkgname"
  cp --no-preserve=ownership -a docs/* "$pkgdir/usr/share/doc/$pkgname"

  cat >> "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec ./$pkgname.pl "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

